package com.future.controller;

import com.future.common.annotation.ControllerMapping;
import com.future.common.annotation.NoNeedLogin;
import com.future.common.base.BaseController;
import com.future.common.utils.IDUtil;
import com.future.dao.GgDao;
import com.future.model.Gonggao;
import com.jfinal.aop.Inject;

/**
 * 公告
 * @author ThinkPad
 *
 */
@ControllerMapping("/gg")
@NoNeedLogin
public class GgController extends BaseController {
	@Inject
	private GgDao ggDao;
	public void queryGg(){
		renderResult("gglist", this.ggDao.findAll());
	}
	public void addGg(String title, String content){
		Gonggao gonggao = new Gonggao();
		gonggao.setGgid(IDUtil.getId());
		gonggao.setTitle(title);
		gonggao.setContent(content);
		gonggao.save();
		renderSuccess();
	}
}
